﻿' LibWowAPI
' by Ronald M. Clifford (roncli@roncli.com)
'
' This source code is released under the GNU Library General Public License (LGPL) Version 2.1.

Imports System
Imports System.Collections.ObjectModel
Imports roncliProductions.LibWowAPI.Data.ItemClasses
Imports roncliProductions.LibWowAPI.Enums

Namespace roncliProductions.LibWowAPI.Item

    ''' <summary>
    ''' A class containing information about an item.
    ''' </summary>
    ''' <remarks></remarks>
    Public Class Item

        ''' <summary>
        ''' The ID number of the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ID As Integer

        ''' <summary>
        ''' The flavor text on the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Description As String

        ''' <summary>
        ''' The name of the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Name As String

        ''' <summary>
        ''' A path leading to the item's icon on the server.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Icon As String

        ''' <summary>
        ''' The number of items that may be put in a single stack.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property StackSize As Integer

        ''' <summary>
        ''' The item's binding type.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ItemBind As Binding

        Private colBonusStats As Collection(Of BonusStats)
        ''' <summary>
        ''' The bonus stats on an item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property BonusStats As Collection(Of BonusStats)
            Get
                Return colBonusStats
            End Get
        End Property

        Private colItemSpells As Collection(Of ItemSpell)
        ''' <summary>
        ''' The various spells provided by this item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property ItemSpells As Collection(Of ItemSpell)
            Get
                Return colItemSpells
            End Get
        End Property

        ''' <summary>
        ''' The price in copper to buy this item, if it's available from a vendor.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Some items are not purchasable, but still have this property set.</remarks>
        Public Property BuyPrice As Integer

        ''' <summary>
        ''' The class of the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ItemClass As [Class]

        Private Property intItemSubClass As Integer
        ''' <summary>
        ''' The subclass of the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>This should only be set by the constructor.</remarks>
        Public ReadOnly Property ItemSubClass As ItemSubClass
            Get
                Return CType(100 * ItemClass.Class + intItemSubClass, ItemSubClass)
            End Get
        End Property

        ''' <summary>
        ''' The number of container slots on the item, if this is a container.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ContainerSlots As Integer

        ''' <summary>
        ''' Information about the weapon, if this is a weapon.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property WeaponInfo As WeaponInfo

        ''' <summary>
        ''' The inventory slot this is equipped on, if this is equippable.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property InventoryType As InventoryType

        ''' <summary>
        ''' Determins whether this item is equippable.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Equippable As Boolean

        ''' <summary>
        ''' The iLevel of the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ItemLevel As Integer

        ''' <summary>
        ''' The maximum number of these items you may have at one time.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>This returns 0 if the max count is unlimiated.</remarks>
        Public Property MaxCount As Integer

        ''' <summary>
        ''' The maximum durability of the item, if it has durability.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property MaxDurability As Integer

        ''' <summary>
        ''' The faction ID that this item requires reputation for in order to buy.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Use with MinStanding to determine how much reputation you need.</remarks>
        Public Property RequiredFactionID As Integer

        ''' <summary>
        ''' The required standing in order to buy this item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Use with RequiredFactionID to determine which faction you need reputation for.</remarks>
        Public Property MinStanding As Standing

        ''' <summary>
        ''' The quality of the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Quality As Quality

        ''' <summary>
        ''' The sell price of the item in copper.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property SellPrice As Integer

        ''' <summary>
        ''' The profession required to use the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property RequiredSkill As Profession

        ''' <summary>
        ''' The level required to use the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property RequiredLevel As Integer

        ''' <summary>
        ''' The required profession skill level to use the item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property RequiredSkillRank As Integer

        Private colSockets As Collection(Of String)
        ''' <summary>
        ''' The sockets available on this item.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Sockets As Collection(Of String)
            Get
                Return colSockets
            End Get
        End Property

        ''' <summary>
        ''' Information on how the item can be obtained.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ItemSource As ItemSource

        ''' <summary>
        ''' The amount of base armor provided, if the item is equippable.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property BaseArmor As Integer

        ''' <summary>
        ''' Determines if the item has sockets.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property HasSockets As Boolean

        ''' <summary>
        ''' Determines if the item is auctionable.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property IsAuctionable As Boolean

        Protected Friend Sub New(intID As Integer, strDescription As String, strName As String, strIcon As String, intStackSize As Integer, bItemBind As Binding, bsBonusStats As Collection(Of BonusStats), isItemSpells As Collection(Of ItemSpell), intBuyPrice As Integer, cItemClass As [Class], intItemSubClass As Integer, intContainerSlots As Integer, wiWeaponInfo As WeaponInfo, itInventoryType As InventoryType, blnEquippable As Boolean, intItemLevel As Integer, intMaxCount As Integer, intMaxDurability As Integer, intRequiredFactionID As Integer, sMinStanding As Standing, qQuality As Quality, intSellPrice As Integer, pRequiredSkill As Profession, intRequiredLevel As Integer, intRequiredSkillRank As Integer, strSockets As Collection(Of String), isItemSource As ItemSource, intBaseArmor As Integer, blnHasSockets As Boolean, blnIsAuctionable As Boolean)
            ID = intID
            Description = strDescription
            Name = strName
            Icon = strIcon
            StackSize = intStackSize
            ItemBind = bItemBind
            colBonusStats = bsBonusStats
            colItemSpells = isItemSpells
            BuyPrice = intBuyPrice
            ItemClass = cItemClass
            Me.intItemSubClass = intItemSubClass
            ContainerSlots = intContainerSlots
            WeaponInfo = wiWeaponInfo
            InventoryType = itInventoryType
            Equippable = blnEquippable
            ItemLevel = intItemLevel
            MaxCount = intMaxCount
            MaxDurability = intMaxDurability
            RequiredFactionID = intRequiredFactionID
            MinStanding = sMinStanding
            Quality = qQuality
            SellPrice = intSellPrice
            RequiredSkill = pRequiredSkill
            RequiredLevel = intRequiredLevel
            RequiredSkillRank = intRequiredSkillRank
            colSockets = strSockets
            ItemSource = isItemSource
            BaseArmor = intBaseArmor
            HasSockets = blnHasSockets
            IsAuctionable = blnIsAuctionable
        End Sub

    End Class

End Namespace
